<?php


class SemanticWebGrid
{
		

	function splitWhere( $where )
	{
		
		return ( count( $where ) ? 
								' WHERE ' . implode( ' AND ', $where ) : 
								'' );
	}
			
			
	function GetFeatures( $user=0 )
	{

		$config	=	new Configuration();	
		
		$db 	=	new MySQL( $config->db_server, 
							$config->db_username, 
							$config->db_password, 
							$config->db_name );

		$where	=	array();

		$where[]=	'username = \''.$username.'\'';
		$where[]=	'password = \''.$password.'\'';
		
		$where	=	$this->splitWhere( $where );
				
																
		$query 	=	'SELECT '
					. ' '				
					. ' id user_id '
					. ' '
					. ' FROM '.$config->db_table_user.' '
					. $where;

		$rows	=	$db->getQuery($query);
		
		if(count( $rows )>0 )
			$result=	$rows[0]->user_id;
		
		
		return $rows;
	}
	
		
	
}
